#ifndef __RADIO_H
#define __RADIO_H

#define IEEE802154_MIN_LENGTH          (5)
#define IEEE802154_MAX_LENGTH          (127)
#define IEEE802154_ACK_LENGTH          (5)

#define IEEE802154_BROADCAST           (0xffff)

#define IEEE802154_FRAME_TYPE_ACK      (2 << 0)
#define IEEE802154_FRAME_TYPE_MACCMD   (3 << 0)
#define IEEE802154_FRAME_TYPE_MASK     (7 << 0)

#define IEEE802154_SECURITY_ENABLED    (1 << 3)
#define IEEE802154_FRAME_PENDING       (1 << 4)
#define IEEE802154_ACK_REQUEST         (1 << 5)
#define IEEE802154_PANID_COMPRESSION   (1 << 6)

#define IEEE802154_DST_ADDR_NONE       (0 << 2)
#define IEEE802154_DST_ADDR_SHORT      (2 << 2)
#define IEEE802154_DST_ADDR_EXT        (3 << 2)
#define IEEE802154_DST_ADDR_MASK       (3 << 2)

#define IEEE802154_SRC_ADDR_NONE       (0 << 6)
#define IEEE802154_SRC_ADDR_SHORT      (2 << 6)
#define IEEE802154_SRC_ADDR_EXT        (3 << 6)
#define IEEE802154_SRC_ADDR_MASK       (3 << 6)

#define IEEE802154_DSN_OFFSET          (2)
#define IEEE802154_DSTPAN_OFFSET       (3)
#define IEEE802154_DSTADDR_OFFSET      (5)

#define IEEE802154_SEC_LEVEL_MASK      (7 << 0)

#define IEEE802154_KEY_ID_MODE_0       (0 << 3)
#define IEEE802154_KEY_ID_MODE_1       (1 << 3)
#define IEEE802154_KEY_ID_MODE_2       (2 << 3)
#define IEEE802154_KEY_ID_MODE_3       (3 << 3)
#define IEEE802154_KEY_ID_MODE_MASK    (3 << 3)

#define IEEE802154_MACCMD_DATA_REQ     (4)

#endif
